package lab02.test03;

/**
 * Created by Administrator on 2017/10/15.
 */

    public class Student {
        String name;
        String number;
        int computer;
        int math;
        int english;//学生的姓名，学号，与计算机，数学，英语成绩

        void getName() {
            System.out.println("姓名:" + name);
        }

        void getNumber() {
            System.out.println("学号:" + number);
        }

        void getGrade() {
            System.out.println("计算机成绩:" + computer);
            System.out.println("数学成绩:" + math);
            System.out.println("英语成绩:" + english);         //输出三科成绩的分数
        }

        void getSumGrade() {
            int sum = computer + math + english;
            System.out.println("三科总分:" + sum);
        }

        void getAverageGrade() {
            int average = (computer + math + english) / 3;
            System.out.println("三科平均分:" + average);
        }

        void getMaxGrade() {
            String str;
            int max = computer;
            if (math > max) {
                max = math;
                str = "数学";
            } else {
                max = computer;
                str = "计算机";
            }

            if (english > math) {
                max = english;
                str = "英语";
            }

            System.out.println("最高分:" + str + max);    //三科中的最高分
        }

        void getMinGrade() {
            String str;
            int min = computer;
            if (math < min) {
                min = math;
                str = "数学";
            } else {
                min = computer;
                str = "计算机";
            }
            if (english < min) {
                min = english;
                str = "英语";
            }
            System.out.println("最低分:" + str + min);   //三科中的最低分
        }
    }


